<?php
/**
 * @package    Joomla.Tutorials
 * @subpackage Components
 * @link http://dev.joomla.org/component/option,com_jd-wiki/Itemid,31/id,tutorials:modules/
 * @license    GNU/GPL
*/

// no direct access

defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');

/**
 * HTML View class for the HelloWorld Component
 *
 * @package    HelloWorld
 */
class calendarsViewconfig extends JView
{
	
    function display($tpl = null)
    {
		
		global $option, $mainframe;
		var_dump('config_view_form');
        JToolBarHelper::title(   JText::_( 'Calendar Configuration' ), 'generic.png' );
       
		JToolBarHelper::save();
		JToolBarHelper::apply();
		JToolBarHelper::cancel();//'','index.php?controller=config&option=com_calendar');

		//build the event categories
		$model = $this->getModel('config');
		//var_dump($model);
		//var_dump($model->_cat_data);
		
		// add pagination
		//$limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit'));
		//$limitstart = JRequest::getVar('limitstart', 0);
		
		/**
		* use new model method veiwCalendar()
		*/
//		$model	=& $this->getModel('config');
		//$data_object =& $model->viewCalendar();
		
		//var_dump('view');
        // Get data from the model
      //	$items =  $this->get('Data');
		
		//var_dump($items);
//		$this->assignRef('items', $items);
	//	$this->assignRef('rows', $data_object->rows);
	//	$this->assignRef('lists', $data_object->lists);
	//	$this->assignRef('pagination', $data_object->pagination);
	//	$this->assignRef('redirect', $data_object->redirect);
		///////////////////////////////////////////
		// Create the event cat form
	//	$cat_html = '';
	//	if(count($model->_cat_data) > 0){
	//		foreach($model->_cat_data as $cat){
				//var_dump($cat);
			//	$this->cat = $cat;
			//	var_dump('view_require');
				//$file = JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.'config'.DS.'form_cat.php';
				//var_dump($file);
			//	ob_start();
			//	require(JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.'config'.DS.'tmpl'.DS.'form_cat.php');
				//echo ob_get_contents();
			//	$cat_html .= ob_get_contents();
			//	ob_end_clean();
				
				//$cat_html .= $this->loadTemplate( 'cat' );
				/*
				$cat_html .= '<div style="float:left;width:175px;">'
							.'<p>'.$cat->id.'&nbsp;&nbsp;&nbsp;'.$cat->title.'</p>';
				
				$iniFormat =& JRegistryFormat::getInstance( 'INI' );
				$params = array();
				$INI = $iniFormat->objectToString( $cat, $params );
				$form = new JParameter($INI);
				$xmlload = $form->loadSetupFile(JPATH_COMPONENT_ADMINISTRATOR.DS.'models'.DS.'cat_data.xml');
				//var_dump($xmlload);
				//var_dump($form);
				$cat_html .= $form->render('params','default');
				
				$cat_html .= '</div>';
				*/
			//	var_dump($form->render());
//			}//edn foreach category
	//	}//end if
		$this->assignRef('cat_data',$model->_cat_data);
		//var_dump($model->_cat_data);
		//$this->assignRef('com_data', $model->_com_data);
		
		// Details Group
		//$active = (intval($item->created_by) ? intval($row->created_by) : $user->get('id'));
		//$form->set('created_by', $active);
		//$form->set('access', $row->access);
		//$form->set('created_by_alias', $row->created_by_alias);

		//$form->set('created', JHTML::_('date', $row->date, '%Y-%m-%d %H:%M:%S'));
		//$form->set('publish_up', JHTML::_('date', $row->publish_up, '%Y-%m-%d %H:%M:%S'));
		//$form->set('publish_down', $row->publish_down);

		// Advanced Group
		//$form->loadINI($row->attribs);

		// Metadata Group
		//$form->set('description', $row->description);
		//$form->set('keywords', $row->metakey);
		//$form->loadINI($row->metadata);
		///////////////////////////////////////////
	//	parent::setLayout('list');//tpl = 'list';
        parent::display($tpl);
    }//end display method
}//end config view class
?>
